/* ==================================================================== */
/* This File Exclaims All the Double Link Node/List Operation Functions */
/*                   And Also The Structs and MACROs                    */
/* ==================================================================== */

#ifndef _DL_EVENT_H
#define _DL_EVENT_H

#include <ctype.h>
#include "d_link_list.h"
#include "test.h"

#define INVALID_DATA 0

typedef enum
{
	INVALID = 0,
	UNEXPECT_NULL_LIST,
	UNEXPECT_EMPTY_LIST_WHEN_INSERT_TO_HEAD,
	UNEXPECT_EMPTY_LIST_WHEN_INSERT_TO_TAIL,
	UNEXPECT_EMPTY_LIST_WHEN_DELETE_NODE,
	NODE_NOT_FOUND,
} DL_EVENT_CODE;

typedef struct _EVENT_TYPE
{
	DL_EVENT_CODE event_code;
	int data;
	struct _EVENT_TYPE *p_prev_event;
	struct _EVENT_TYPE *p_next_event;
}DL_EVENT_T;

typedef struct _EVENT_QUEUE
{
	int event_count;
	DL_EVENT_T *p_event_head;
	DL_EVENT_T *p_event_tail;
}DL_EVENT_Q;


extern DL_EVENT_Q *p_dl_event_q;


extern void process_dl_events();
extern DL_EVENT_T *get_dl_event(void);
extern int post_dl_event(DL_EVENT_CODE e_code, int data);
extern DL_EVENT_T *malloc_dl_event(void);
extern int free_dl_event(DL_EVENT_T *p_dl_event);



#endif
